﻿#parse("partials/headerpopup.html")
<style>
    div#datalist_filter
    {
        display: none;
    }
    div#datalist_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {

        var oTable = $('#datalist').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": false,
            "bServerSide": true,
            "bFilter": true,
            "sAjaxSource": "/purchasing/purchaserequisition/tablelistsearchitem/",
            "aoColumns": [
                                { "mDataProp": "Id" },
                                { "mDataProp": "NameValue" }


                            ],
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a class='dok' title='Select Doctor' href='javascript:void(0)' Id='" + o.aData['Id'] + "'itemname='" + o.aData['NameValue'] + "' ><img src='/images/Icons/table.png'/></a> </center>";
                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "bankname", "value": $('#bankname').val() });
                aoData.push({ "name": "swiftcode", "value": $('#swiftcode').val() });

                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": "/purchasing/purchaserequisition/tablelistsearchitem/",
                    "data": aoData,
                    "success": fnCallback
                });
            }
        })

        $('#buttonSearch').click(function () {
            oTable.fnDraw();
        });

    });
    //Add event click on list doctor
    $(".dok").live('click', function (event) {
        var itemid = $(this).attr("Id");
        var itemname = $(this).attr("itemname");
        parent.setPresentItemTextBox(itemid, itemname);

    });

</script>
<div class="mws-form" action="#">
    <div class="mws-form-inline">
        <div class="mws-form-row">
            <label>
                Item Code</label>
            <div class="mws-form-item large">
                <div class="mws-form-cols clearfix">
                    <div class="mws-form-col-2-8 alpha">
                        <div class="mws-form-item">
                            <input id="itemcode" type="text" class="mws-textinput" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="mws-form-row">
            <label>
                Item Name</label>
            <div class="mws-form-item large">
                <div class="mws-form-cols clearfix">
                    <div class="mws-form-col-2-8 alpha">
                        <div class="mws-form-item">
                            <input id="itemname" type="text" class="mws-textinput" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    <div class="mws-button-row">
        <input id="buttonSearch" type="submit" value="Search" class="mws-button red" />
    </div>
    <div class="mws-form-row" style="padding-top: 10px">
        <table cellpadding="0" cellspacing="0" border="0" class="mws-table" id="datalist"
            width="100%">
            <thead>
                <tr>
                    <th style="width: 100px; text-align: center">
                        Actions
                    </th>
                    
                    <th style="text-align: center">
                        Item Name
                    </th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
</div>
#parse("partials/footerpopup.html")